/*
//              INTEL CORPORATION PROPRIETARY INFORMATION
//  This software is supplied under the terms of a license  agreement or
//  nondisclosure agreement with Intel Corporation and may not be copied
//  or disclosed except in  accordance  with the terms of that agreement.
//    Copyright (c) 2003-2007 Intel Corporation. All Rights Reserved.
//
//
*/
#include "umc_defs.h"
#if defined (UMC_ENABLE_DV50_VIDEO_DECODER)

#ifndef __UMC_DV50_DECODER_H
#define __UMC_DV50_DECODER_H

#include "umc_dv_decoder.h"

namespace UMC
{

class DV50VideoDecoder : public DVVideoDecoder
{

public:
    // Default constructor
    DV50VideoDecoder(void);
    // Destructor
    ~DV50VideoDecoder(void);

    // Initialize DV50 decoder
    virtual Status Init(BaseCodecParams *init);

    // Close decoder
    virtual Status Close(void);

    // Decode next frame
    //virtual Status GetFrame(MediaData *pInData, MediaData *pOutData);

    // Get decoder performance
    virtual Status GetPerformance(Ipp64f *perf);

    // Reset decoder into initial state
    virtual Status Reset(void);

    // reset skip frame counter
    virtual Status ResetSkipCount(void) {return UMC_ERR_NOT_IMPLEMENTED;};

    // increment skip frame counter
    virtual Status SkipVideoFrame(Ipp32s ){return UMC_ERR_NOT_IMPLEMENTED;};

    // get skip frame counter statistic
    virtual Ipp32u GetNumOfSkippedFrames(void) {return 0;};

protected:
    // Decompress DV segment
    virtual void DecompressSegment(Ipp32u nThreadNum);

    // Function for processing incorrect params in GetFrame method
    virtual void CheckSetCorrectParams(int byteDSF);

    // Fill correspond dest & source pointers
    void InitializeStoreDV50Info(STORE_DV_SEGMENT_INFO &PasteInfo, Ipp32u i, Ipp32u k, Ipp32u ThreadNum);

    // Select function 'StoreDVSegment'
    virtual void SelectStoreFunction(void *pSource);

    // Store uncompressed DV segment
    void StoreDV50Segment(Ipp32u i, Ipp32u k, Ipp32u nThreadNum);
    void StoreDV50Segment_2s(Ipp32u i, Ipp32u k, Ipp32u nThreadNum);
    void StoreDV50Segment_4s(Ipp32u i, Ipp32u k, Ipp32u nThreadNum);
    void StoreDV50Segment_8s(Ipp32u i, Ipp32u k, Ipp32u nThreadNum);

    void (DV50VideoDecoder::*StoreDVSegment)(Ipp32u i, Ipp32u k, Ipp32u nThreadNum);  // (void (*)(Ipp32u, Ipp32u, Ipp32u) pointer to store function

    Ipp32u m_nMaxNumberOfDIFSequences;                        // (Ipp32u) maximum number of DIF sequences

};

} // end namespace UMC

#endif // __UMC_DV50_DECODER_H

#endif //(UMC_ENABLE_DV50_VIDEO_DECODER)
